package com.share.user.factory;

import com.share.common.core.constant.MessageConstant;
import com.share.common.core.domain.R;
import com.share.common.core.exception.ServiceException;
import com.share.user.api.RemoteUserService;
import com.share.user.domain.UpdateUserLogin;
import com.share.user.domain.UserInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteUserInfoFallbackFactory implements FallbackFactory<RemoteUserService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteUserInfoFallbackFactory.class);

    @Override
    public RemoteUserService create(Throwable cause) {
        log.error("用户服务调用失败:{}", cause.getMessage());
        throw new ServiceException("调用出现错误");
    }
}